package cn.com.xyc.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;

import cn.com.xyc.pojo.Project;

public class ProjectDao extends BaseDao {
	/**
	 * 
	 * @return
	 */
	public List<Project> findAll() {
		Session session = openSession();
		Query query = session.createQuery("from Project");
		List<Project> proLists = query.list();
		session.close();
		return proLists;
	}

	public void insert(Project project) {
		Session session = openSession();
		Transaction trans = session.beginTransaction();
		session.save(project);
		trans.commit();
		session.close();
	}
}
